// 组件间共享的类型定义

// 标签类型接口
export interface TagItem {
  label: string
  value: string
  type: "" | "primary"
}

// 银行类型接口
export interface BankTypeItem {
  type_id: number
  type_name: string
  created_at: string
  updated_at: string
}

// 金额范围接口
export interface AmountRangeItem {
  name: string
  range_id: number
  bank_id: number
  bank_name: string
  min_amount: string
  max_amount: string
  created_at: string
  updated_at: string
}

// 利率项目接口
export interface RateItem {
  date_range_id: number
  range_id: number
  start_date: string
  end_date: string
  min_amount?: string
  max_amount?: string
  amount_range?: string
}

// 利率模式类型
export type RateMode = "FIXED" | "FLOAT" | "FIXED_AMOUNT"

// 利率类型
export type RateType = "amount" | "rate"

// 组件事件接口
export interface FilterEvents {
  // 票据类型相关事件
  "ticket-type-change": (selectedTypes: TagItem[]) => void
  "ticket-type-add": (typeName: string) => void
  "ticket-type-delete": (tag: TagItem) => void

  // 金额范围相关事件
  "amount-range-change": (selectedRanges: TagItem[]) => void
  "amount-range-add": (startValue: string, endValue: string) => void
  "amount-range-delete": (tag: TagItem) => void

  // 到期日期相关事件
  "due-date-change": (selectedDates: TagItem[]) => void
  "due-date-add": (startDate: string, endDate: string) => void
  "due-date-delete": (tag: TagItem) => void

  // 利率配置相关事件
  "rate-change": (value: number | undefined, mode: RateMode, type: RateType) => void
  "rate-submit": (value: number, mode: RateMode, type: RateType) => void
  "rate-type-toggle": (type: RateType) => void
}
